import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XyywWxUserForm, XyywWxUserQuery, XyywWxUserVo } from '@/api/xyyw/model/wxUserModel';
import { request } from '@/utils/request';

// 查询微信用户列表
export function listWxUser(query?: XyywWxUserQuery) {
  return request.get<TableDataInfo<XyywWxUserVo>>({
    url: '/xyyw/wxUser/list',
    params: query,
  });
}

// 查询微信用户详细
export function getWxUser(id: number) {
  return request.get<R<XyywWxUserVo>>({
    url: `/xyyw/wxUser/${id}`,
  });
}

// 新增微信用户
export function addWxUser(data: XyywWxUserForm) {
  return request.post<R<void>>({
    url: '/xyyw/wxUser',
    data,
  });
}

// 修改微信用户
export function updateWxUser(data: XyywWxUserForm) {
  return request.put<R<void>>({
    url: '/xyyw/wxUser',
    data,
  });
}

// 删除微信用户
export function delWxUser(ids: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xyyw/wxUser/${ids}`,
  });
}
